import bcrypt

passwd: str = 'i love you'
right_passwd: str = passwd
wrong_passwd: str = 'hello world'

# bcrypt.gensalt(rounds=12, prefix=b'2b')
# rounds: 4 - 31, prefix: b'2a', b'2b'
salt: bytes = bcrypt.gensalt()
print([passwd, salt])

hash_passwd: bytes = bcrypt.hashpw(passwd.encode('utf-8'), bcrypt.gensalt())
print(hash_passwd)

status1: bool = bcrypt.checkpw(right_passwd.encode('utf-8'), hash_passwd)
status2: bool = bcrypt.checkpw(wrong_passwd.encode('utf-8'), hash_passwd)
print([status1, status2])
